import 'competition.dart';

class OdfBody {
  String? competitionCode;
  String? documentCode;
  String? documentType;
  String? version;
  String? resultStatus;
  String? feedFlag;
  String? date;
  String? time;
  String? logicalDate;
  String? source;
  Competition? competition;

  OdfBody({
    this.competitionCode,
    this.documentCode,
    this.documentType,
    this.version,
    this.resultStatus,
    this.feedFlag,
    this.date,
    this.time,
    this.logicalDate,
    this.source,
    this.competition,
  });

  factory OdfBody.fromJson(Map<String, dynamic> json) => OdfBody(
        competitionCode: json['CompetitionCode'] as String?,
        documentCode: json['DocumentCode'] as String?,
        documentType: json['DocumentType'] as String?,
        version: json['Version'] as String?,
        resultStatus: json['ResultStatus'] as String?,
        feedFlag: json['FeedFlag'] as String?,
        date: json['Date'] as String?,
        time: json['Time'] as String?,
        logicalDate: json['LogicalDate'] as String?,
        source: json['Source'] as String?,
        competition: json['Competition'] == null
            ? null
            : Competition.fromJson(json['Competition'] as Map<String, dynamic>),
      );

  Map<String, dynamic> toJson() => {
        'CompetitionCode': competitionCode,
        'DocumentCode': documentCode,
        'DocumentType': documentType,
        'Version': version,
        'ResultStatus': resultStatus,
        'FeedFlag': feedFlag,
        'Date': date,
        'Time': time,
        'LogicalDate': logicalDate,
        'Source': source,
        'Competition': competition?.toJson(),
      };
}
